Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-d:nimLegacyHomeDir for 1.6: avoid a breaking change in 1.6, keep bugfix in devel #18486

Closed

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Jul 13, 2021

I would prefer to have the bugfix go in 1.6, but as a last resort, this is an alternative to #18480 to at least keep the bugfix for #17393 in devel.
refs #18480 (comment)

much better than reverting the commits as was attempted in #18480, likewise with other reverts that are currently pending and other similar reverts that were made in 1.5.

  • People targeting stable cannot complain anymore and have more time to migrate to new behavior (they'll know what lines of code need attention thanks to warnings we can add for each use of deprecated behavior)
  • they'll also be able to opt-in to new behavior in a targeted way (1 feature at a time)
  • people targeting devel get their bugfixes and saner, more consistent behavior, by default, without having to wait for next major bump.

this will then work in devel using new semantics, and work on 1.6 using old semantics, but still be over-rideable with either cmdline flag -u:nimLegacyHomeDir or a flag in your user config -u:nimLegacyHomeDir. Code can query which behavior is used using when defined(nimLegacyHomeDir).

if 1.8 is released in future (instead of 2.0), the question can be asked again at that time whether 1.8 wants the old or new behavior for each individual breaking change, and the logic can be extended accordingly with a 1 line change, all in 1 place ($nim/config/config.nims).

This isn't a perfect solution but it's a better solution than removing bugfixes or cementing bad design decisions, and it allows users that want those bug fixes and the better design to get it as default without waiting for the next major bump (2.0, or when 2.0 has a bug, 3.0). Instead, they can at least get it in devel, and eventually get it in some stable branch (whether 1.8 or 2.0).

The key part is that in devel, the sane behavior should be the default, not an opt-in flag that requires adding a flag. That is the only way to prevent balkanization in the long term.

In future work, a localizable approach can be implemented, such that a project A can opt-in new semantics in a stable branch while the rest uses the default semantic for that branch; it's tricky but doable.

future work

@timotheecour timotheecour changed the title -d:nimLegacyHomeDir for 1.6 -d:nimLegacyHomeDir for 1.6: avoid a breaking change in 1.6, keep bugfix in devel Jul 13, 2021
@Araq
Copy link
Member

Araq commented Jul 16, 2021

It's not a "bugfix" to begin with, it's just another change in behavior that causes work for everybody who already uses Nim, the benefit is that 1 thing out of millions is then easier for the new people translating their codebases from Python. Which is otherwise oh so easy to do that we should care about this...

@timotheecour timotheecour marked this pull request as draft July 17, 2021 21:28
@timotheecour
Copy link
Member Author

It's not a "bugfix" to begin with, it's just another change in behavior that causes work for everybody who already uses Nim, the benefit is that 1 thing out of millions is then easier for the new people translating their codebases from Python.

this has been discussed elsewhere: because it was inconsistent both with all other languages and all other APIs in nim that return a dir, see long list here: #17393 (comment), consistency is still a thing.

But, I'm drafting this PR because I found a better approach: #18513 which should make migration a lot easier.

@Araq Araq closed this Jul 18, 2021
@timotheecour timotheecour mentioned this pull request Aug 8, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants